home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.xa.undo;
-
- import com.extensibility.app.UI;
- import com.extensibility.util.Debug;
- import com.extensibility.xa.EntityModel;
- import com.extensibility.xa.XADesktop;
- import com.extensibility.xml.BaseDeclaration;
- import com.extensibility.xml.EntityDeclaration;
- import com.extensibility.xml.InternalPEDeclaration;
- import com.extensibility.xml.ParserException;
-
- public class InternalEntValueUndoable extends DeclTableUndoable {
- EntityDeclaration entityDecl;
-
- public InternalEntValueUndoable(EntityModel var1, BaseDeclaration var2, Object var3) {
- super(XADesktop.getTableForModel(var1), var2, var3);
- this.entityDecl = (EntityDeclaration)var2;
- super.oldValue = ((EntityModel)super.tableModel).getValueAt(super.tableModel.getRowForDecl(this.entityDecl), 3);
- }
-
- public String getPresentationName() {
- return ((EntityModel)super.tableModel).isGE() ? UI.getString("undo.ige.value") : UI.getString("undo.ipe.value");
- }
-
- public void undo() {
- super.undo();
- this.entityDecl.setValue((String)super.oldValue);
- if (this.entityDecl instanceof InternalPEDeclaration) {
- this.updateModelAndAttrGroups((InternalPEDeclaration)this.entityDecl);
- }
-
- ((DeclTableUndoable)this).setCellFocus(super.tableModel.getRowForDecl(this.entityDecl), 3);
- }
-
- void updateModelAndAttrGroups(InternalPEDeclaration var1) {
- if (var1.getContentModel() != null) {
- try {
- ((DeclTableUndoable)this).getSchemaDoc().setMuteDeclChanges(true);
- ((DeclTableUndoable)this).getSchemaDoc().updateContentModel(var1, ((EntityDeclaration)var1).getValue());
- } catch (ParserException var9) {
- Debug.assert(var9);
- } finally {
- ((DeclTableUndoable)this).getSchemaDoc().setMuteDeclChanges(false);
- var1.modelStateChanged(var1.getContentModel(), 31, super.oldValue);
- }
- }
-
- if (var1.getAttributeGroup() != null) {
- try {
- ((DeclTableUndoable)this).getSchemaDoc().updateAttributeGroup(var1, ((EntityDeclaration)var1).getValue());
- } catch (ParserException var8) {
- Debug.assert(var8);
- }
- }
-
- }
-
- public void doCommand() {
- this.entityDecl.setValue((String)super.newValue);
- if (this.entityDecl instanceof InternalPEDeclaration) {
- this.updateModelAndAttrGroups((InternalPEDeclaration)this.entityDecl);
- }
-
- }
-
- public void redo() {
- super.redo();
- this.doCommand();
- ((DeclTableUndoable)this).setCellFocus(super.tableModel.getRowForDecl(this.entityDecl), 3);
- }
- }
-